package com.yl.nettylearning.netty.rpc.customer;

import com.yl.nettylearning.netty.rpc.netty.NettyClient;
import com.yl.nettylearning.netty.rpc.publicinterface.HelloService;

/**
 * @author yangl
 */
public class ClientBootstrap {
    /**
     * 定义一个协议头
     */
    public static final String providerName = "HelloService#";

    public static void main(String[] args) {
        //创建一个消费者
        NettyClient client = new NettyClient();
        //创建代理对象
        HelloService service = (HelloService) client.getBean(HelloService.class, providerName);
        //通过代理对象调用服务器提供的方法
        String hello = service.Hello("你好  dubbo rpc");
        System.out.println(hello);
    }
}
